<header class="page-header clearfix">
    <h4><a ng-href="#/k8s"><i class="fa fa-arrow-left"></i></a>服务</h4>
    <ol class="breadcrumb">
        <li><a ng-href="#/k8s">容器集群</a></li>
        <li class="active">服务</li>
    </ol>
</header>
<section>
    <ui-panel class="panel-list">
        <form class="form-inline form-search" ng-submit="list.search()">
            <div class="form-group">
                <input type="text" maxlength="50" ng-model="list.filter.name" class="form-control" placeholder="请输入名称查询"/>
            </div>
            <button class="btn btn-default" type="submit">查询</button>
        </form>
        <table class="table table-hover">
            <thead>
            <tr>
                <th width="25%">名称</th>
                <th width="10%">命名空间</th>
                <th width="10%">概况</th>
                <th width="45%">镜像</th>
                <th width="15%">发布时间</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="elem in list.table">
                <td><a ui-sref="k8s-service-detail.pod({name:elem.name,namesp: elem.namespace, kDbCode: list.dbCode})">{{::elem.name}}</a></td>
                <td>{{::elem.namespace}}</td>
                <td>
                    <ul class="list-inline">
                        <li ui-tooltip="{{::elem.podInfo.running}} Running" class="text-success"><i class="fa fa-circle"></i> {{::elem.podInfo.running}}</li>
                        <li ui-tooltip="{{::elem.podInfo.desired}} Desired"><i class="fa fa-circle"></i> {{::elem.podInfo.desired}}</li>
                    </ul>
                </td>
                <td>{{::elem.containerImages.join(', ')}}</td>
                <td>{{::elem.creationTime | date:'yyyy-MM-d HH:mm:ss'}}</td>
            </tr>
            </tbody>
        </table>
        <!--Loading-->
        <div class="loading" ng-show="!list.table"></div>
        <!--分页-->
        <div ng-show="list.table" class="pagination-group">
            <ui-pagination-info items-per-page="10" items-per-page-select="false"
                                total-items="list.page.totalItems"
                                current-page="list.page.currentPage"></ui-pagination-info>
            <button type="button" ng-click="list.getList()" class="btn btn-default btn-refresh"><i class="fa fa-refresh"></i></button>
            <ui-pagination items-per-page="10" total-items="list.page.totalItems"
                           ng-model="list.page.currentPage" ng-change="list.getList()"></ui-pagination>
        </div>
    </ui-panel>
</section>